package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.NotNull;

/**
 * StorageGridPurchaser generated by hbm2java
 */
@Entity
@Table(name = "storage_grid_purchaser", catalog = "cabinet")
public class StorageGridPurchaser implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer storageGridPurchaserId;
	private StorageGrid storageGrid;
	private Purchaser purchaser;
	private Date insertTime;
	private int open;

	public StorageGridPurchaser() {
	}

	public StorageGridPurchaser(StorageGrid storageGrid, Purchaser purchaser,
			int open) {
		this.storageGrid = storageGrid;
		this.purchaser = purchaser;
		this.open = open;
	}

	public StorageGridPurchaser(StorageGrid storageGrid, Purchaser purchaser,
			Date insertTime, int open) {
		this.storageGrid = storageGrid;
		this.purchaser = purchaser;
		this.insertTime = insertTime;
		this.open = open;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "storage_grid_purchaser_id", unique = true, nullable = false)
	public Integer getStorageGridPurchaserId() {
		return this.storageGridPurchaserId;
	}

	public void setStorageGridPurchaserId(Integer storageGridPurchaserId) {
		this.storageGridPurchaserId = storageGridPurchaserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_storage_grid_id", nullable = false)
	@NotNull
	public StorageGrid getStorageGrid() {
		return this.storageGrid;
	}

	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "purchaser_purchaser_id", nullable = false)
	@NotNull
	public Purchaser getPurchaser() {
		return this.purchaser;
	}

	public void setPurchaser(Purchaser purchaser) {
		this.purchaser = purchaser;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "open", nullable = false)
	public int getOpen() {
		return this.open;
	}

	public void setOpen(int open) {
		this.open = open;
	}

}
